package com.jctrip.hotel.source.xxl.cnbe;

import com.jctrip.hotel.common.constant.XxlJobNameConstant;
import com.jctrip.hotel.source.service.CNBooking.CNBookingTaskService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author：Haruhi
 * @description: 推送香港，澳门酒店价格
 * @Date：2023/9/5 18:16
 * @Package：com.jctrip.hotel.source.xxl.cnbe
 * @Project：hotel-main
 */
@Slf4j
@Component
public class SyncCNBEXgAmRatesTaskPushXxlJob extends IJobHandler {
    @Resource
    private CNBookingTaskService cnBookingTaskService;

    @Override
    @XxlJob(XxlJobNameConstant.SYNC_CNBE_XG_AM_RATES_PUSH)
    public void execute() throws Exception {
        XxlJobHelper.log(XxlJobNameConstant.SYNC_CNBE_XG_AM_RATES_PUSH + " xxl job start");
        try {
            cnBookingTaskService.syncCNBEXgAmRatesTaskPush();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
        XxlJobHelper.log(XxlJobNameConstant.SYNC_CNBE_XG_AM_RATES_PUSH + " xxl job end");
    }
}
